package cn.tx.service.Impl;

import cn.tx.dao.GradeDao;
import cn.tx.dao.TeacherDao;
import cn.tx.model.Grade;
import cn.tx.model.Teacher;
import cn.tx.service.GradeService;
import cn.tx.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherDao teacherDao;

    @Override
    public Teacher findByName(String tname) {
        return teacherDao.findByName(tname);
    }

    @Override
    public int addTeacher(Teacher teacher) {
        return teacherDao.addTeacher (teacher);
    }
    @Override
    public List<Teacher> findList(Map<String, Object> querymap) {
        return teacherDao.findList(querymap);
    }

    @Override
    public List<Teacher> findAll() {
        return teacherDao.findAll();
    }

    @Override
    public int findTotal(Map<String, Object> querymap) {
        return teacherDao.findTotal(querymap);
    }


    @Override
    public int UpdateById(Teacher teacher) {
       return  teacherDao.UpdateById(teacher);
    }

    @Override
    public int delete(String ids) {
        return teacherDao.delete(ids);
    }

    @Override
    public Teacher findByUsername(String username) {
        return teacherDao.findByUsername(username);
    }

}
